<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<script>
    var index = '<%=request.getParameter("index")%>';
    // alert("index:" + index);
    $(function(){
        $(".Baby_Healthy_home_left_sideBar_li").eq(index - 1).addClass("lightAct").siblings().removeClass("lightAct");
        $(".Baby_Healthy_home_left_sideBar_li").eq(index - 1).find('a').addClass("Baby_Healthy_home_left_sideBar_li_bgc").parents('li').siblings().find('a').removeClass("Baby_Healthy_home_left_sideBar_li_bgc");
    });
</script>

<!DOCTYPE>
<div class="Baby_Healthy_home_left">
    <div class="Baby_Healthy_home_left_logo">
        <img class="Baby_Healthy_home_left_img" src="${pageContext.request.contextPath}/images/logo.png"/>
        <div class="Baby_Healthy_home_left_name">
            <p class="Baby_Healthy_home_left_name_tit">小儿推拿</p>
            <p class="Baby_Healthy_home_left_name_tip">${sessionScope.CURRENT_USER_4_POJO.subclinicName}</p>
        </div>
    </div>
    <ul class="Baby_Healthy_home_left_sideBar">
        <li class="Baby_Healthy_home_left_sideBar_li"><a class="color_direct" href="${pageContext.request.contextPath}/"><i class="icon iconfont icon-icon-test14"></i>工作台</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li js_power_8_9_47"><a class="color_direct" href="${pageContext.request.contextPath}/booking/gotoBespeak"><i class="icon iconfont icon-icon-test16"></i>预约管理</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li js_power_49_50_69"><a class="color_direct" href="${pageContext.request.contextPath}/order/gotoOrder"><i class="icon iconfont icon-icon-test4"></i>订单管理</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li js_power_54_55"><a class="color_direct" href="${pageContext.request.contextPath}/patient/gotoUserlib"><i class="icon iconfont icon-icon-test5"></i>宝宝库</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li"><a class="color_direct" href="${pageContext.request.contextPath}/user/gotoVip"><i class="icon iconfont icon-icon-test3"></i>会员中心</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li js_power_24_25"><a class="color_direct" href="${pageContext.request.contextPath}/card/gotoCardManagement"><i class="icon iconfont icon-icon-test6"></i>卡券管理</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li"><a class="color_direct" href="${pageContext.request.contextPath}/subclinic/gotoStoreSetting"><i class="icon iconfont icon-icon-test9"></i>门店设置</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li"><a class="color_direct" href="${pageContext.request.contextPath}/sysuser/gotoCtaffManagement"><i class="icon iconfont icon-icon-test10"></i>员工管理</a></li>
        <li class="Baby_Healthy_home_left_sideBar_li js_power_40_41_44"><a class="color_direct" href="${pageContext.request.contextPath}/ad/gotoInit"><i class="icon iconfont icon-icon-test15"></i>基础设置</a></li>
    </ul>
    <div class="js_session_data">
        <input type="hidden" name="xrtnUserId" value="${sessionScope.CURRENT_USER_4_POJO.userId}">
        <input type="hidden" name="xrtnUserName" value="${sessionScope.CURRENT_USER_4_POJO.userName}">
        <input type="hidden" name="xrtnUserNo" value="${sessionScope.CURRENT_USER_4_POJO.userNo}">
        <input type="hidden" name="xrtnUserImg" value="${sessionScope.CURRENT_USER_4_POJO.userImg}">
        <input type="hidden" name="xrtnSubclinicName" value="${sessionScope.CURRENT_USER_4_POJO.subclinicName}">
        <input type="hidden" name="xrtnSubclinicId" value="${sessionScope.CURRENT_USER_4_POJO.subclinicId}">
        <input type="hidden" name="xrtngoUrl" value="${pageContext.request.contextPath}">
        <input type="hidden" name="xrtnPos" value="${sessionScope.CURRENT_USER_4_POJO.roleFunctionStr}">
    </div>
    <div class="Baby_Healthy_home_left_bottom">
        <img style="border-radius:50%;" src="${sessionScope.CURRENT_USER_4_POJO.userImg}"><span class="js_loginName" style="margin-left: -20px;">${sessionScope.CURRENT_USER_4_POJO.userName}</span>
    </div>
    <div class="user_settingwrap">
        <ul>
            <li><a href="javascript:void(0)" class="changepwd">修改密码</a></li>
            <li><a href="javascript:void(0)" class="quituser">退出</a></li>
        </ul>
    </div>
    <div class="changepwdelm hidden">
        <form action="">
        <div class="form-group form-row">
            <label for="" class="control-label font_right col-sm-4">登录帐号：</label>
            <p class="form-control-static col-sm-8">${sessionScope.CURRENT_USER_4_POJO.userNo}</p>
        </div>
        <div class="form-group form-row">
            <label for="" class="control-label font_right col-sm-4">*初始密码：</label>
            <div class="col-sm-7">
                <input type="text" class="form-control" name="oldPwd" placeholder="请输入初始密码" datatype="*" errormsg="输入有误" nullmsg="请输入初始密码" />
                <span class='Validform_checktip Validform_error2' />  
            </div>
            
        </div>
        <div class="form-group form-row">
            <label for="" class="control-label font_right col-sm-4">*新密码：</label>
            <div class="col-sm-7">
                <input type="password" name="userPwd" class="form-control" placeholder="请输入新密码"  datatype="*6-16" errormsg="输入有误6-16位" nullmsg="请输入新密码"/>
                <span class='Validform_checktip Validform_error2' /> 
            </div>
             
        </div>
        <div class="form-group form-row">
            <label for="" class="control-label font_right col-sm-4">*确认密码：</label>
            <div class="col-sm-7">
                <input type="password" class="form-control" recheck="userPwd" datatype="*6-18" errormsg="两次输入不一致" nullmsg="请再次输入新密码" placeholder="再次输入新密码"/>
                <span class='Validform_checktip Validform_error2' />  
            </div>
            
        </div>
        </form>
    </div>
    <script>

        $(".Baby_Healthy_home_left_sideBar_li").on("click",function(){
            $.session.clear();
        });

        baseFn.getSession(${sessionScope.CURRENT_USER_4_POJO.roleFunctionStr})

        $(function () {
            $("#sysUserNo").html(SessionData.userNo);
        })

        $('.js_loginName').on('click',function(){
            $('.user_settingwrap').addClass('pop')
            return false
        })
        $(document).off('click.loginBtn').on('click.loginBtn',function(){
            $('.user_settingwrap').removeClass('pop')
        })
        $('.changepwd').on('click',function(){
            baseFn.dialog({
                title:'更改密码',
                content:$('.changepwdelm'),
                width:'30em',
                ok:function(){
                    if(!changePwdValid.check()){
                        return false
                    }
                    var _changePwdInfo={
                        userId:SessionData.userId,
                        oldPwd :$.trim($('input[name=oldPwd]').val()),
                        userPwd:$.trim($('input[name=userPwd]').val())
                    }
                    $.post(baseUrl.base+'changepwd',_changePwdInfo,function(res){
                        if(res.code == 0){
                            baseFn.infoDialog('修改成功！请重新登陆',function(){
                                window.location.href=baseUrl.gobase+'gotoLogin'
                            },2000,function(){
                                window.location.href=baseUrl.gobase+'gotoLogin'
                            })
                        }else{
                            baseFn.infoDialog(res.msg)
                        }
                    },'json')
                },
                cancel:function(){}
            })
        })
        $('.quituser').on('click',function(){
            baseFn.dialog({
                content:'确定退出么？',
                ok:function(){
                    window.location.href="${pageContext.request.contextPath}/gotoLogin"
                },
                cancel:function(){}
            })
        })
        var changePwdValid = $(".changepwdelm").Validform({
            tiptype:3
        }); 
    </script>
</div>
